<template>
  <div class="base-panel">
    <!-- 头部 -->
    <div class="header">
      <div class="header-bg"></div>
      <slot name="header"></slot>
      <div class="header-close" @click="closeDialog"> </div>
    </div>
    <!-- 内容 -->
    <div class="main">
      <slot name="main"></slot>
    </div>
  </div>
</template>

<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
@Component({
  name: "BasePaenl"
})
export default class extends Vue {
  // 关闭弹框
  closeDialog() {
    this.$store.commit("panel/setDialogShow", false);
  }
}
</script>

<style lang="scss" scoped>
.base-panel {
  .header {
    width: 100%;
    height: 40px;
    padding: 15px 15px 0 15px;
    .header-bg {
      position: absolute;
      width: calc(100% - 30px);
      height: 32px;
      background-image: url(../../assets/images/dialogs/tuanchuangbiaotibeijing.png);
      background-size: 100% 100%;
      margin-top: 2px;
    }
    .header-title {
      width: calc(100% - 30px);
      height: 17px;
      font-family: AlibabaPuHuiTi_2_85_Bold;
      font-size: 18px;
      line-height: 20px;
      color: #ffffff;
      padding-left: 25px;
      position: absolute;
    }
    .header-close {
      position: absolute;
      left: calc(100% - 40px);
      width: 20px;
      height: 20px;
      background-image: url(../../assets/images/dialogs/tanchuangguanbi.png);
      background-size: 100% 100%;
      cursor: pointer;
    }
  }
  .main {
    width: 100%;
    padding: 15px;
  }
}
</style>
